projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
26187a3
)
Fix handling of PBM data
author
Eli Zaretskii
<eliz@gnu.org>
Sat, 11 Feb 2017 09:09:33 +0000
(11:09 +0200)
committer
Eli Zaretskii
<eliz@gnu.org>
Sat, 11 Feb 2017 09:09:33 +0000
(11:09 +0200)
* src/image.c (pbm_load): Handle PBM data with no blanks between
individual pixel values correctly. (Bug#25660)
src/image.c
patch
|
blob
|
history
diff --git
a/src/image.c
b/src/image.c
index ad0143be48b0a6a3c3259e26f3cee6717e37c522..a7a94165282cd9f72e6285d17f2d4884757a1147 100644
(file)
--- a/
src/image.c
+++ b/
src/image.c
@@
-5465,7
+5465,17
@@
pbm_load (struct frame *f, struct image *img)
c <<= 1;
}
else
- g = pbm_scan_number (&p, end);
+ {
+ int c = 0;
+ /* Skip white-space and comments. */
+ while ((c = pbm_next_char (&p, end)) != -1 && c_isspace (c))
+ ;
+
+ if (c == '0' || c == '1')
+ g = c - '0';
+ else
+ g = 0;
+ }
#ifdef USE_CAIRO
*dataptr++ = g ? fga32 : bga32;